package com.yixin.token.exceptions;

public class ClientException extends Exception {

	private static final long serialVersionUID = 1L;

	private String errorCode;

	private String errorMsg;

	private ErrorType errorType;

	public ClientException() {
		super();
	}

	public ClientException(Throwable cause) {
		super(cause);
		this.setErrorType(ErrorType.Client);
	}
	
	public ClientException(String msg, Throwable cause) {
		super(msg, cause);
		this.errorMsg = msg;
		this.setErrorType(ErrorType.Client);
	}
	
	public ClientException(String errorCode, String errorMsg, Throwable cause) {
		super(errorCode + ":" + errorMsg, cause);
		this.errorCode = errorCode;
		this.errorMsg = errorMsg;
		this.setErrorType(ErrorType.Client);
	}

	public ClientException(String msg) {
		super(msg);
		this.errorMsg = msg;
		this.setErrorType(ErrorType.Client);
	}
	
	
	public ClientException(String errorCode, String errorMsg) {
		super(errorCode + ":" + errorMsg);
		this.errorCode = errorCode;
		this.errorMsg = errorMsg;
		this.setErrorType(ErrorType.Client);
	}


	public String getErrorMsg() {
		return errorMsg;
	}

	public void setErrorMsg(String errorMsg) {
		this.errorMsg = errorMsg;
	}

	public ErrorType getErrorType() {
		return errorType;
	}

	public void setErrorType(ErrorType errorType) {
		this.errorType = errorType;
	}

}
